package org.hansk.wg.game
{
	import org.hansk.wg.game.controllers.InitCommand;
	
	import flash.display.DisplayObjectContainer;
	
	import org.robotlegs.base.ContextEvent;
	import org.robotlegs.core.IContext;
	import org.robotlegs.mvcs.Context;
	
	import starling.core.Starling;
	
	/**
	 * @file MainContext.as
	 * @explain 主上下文实例
	 * @copyright it.hansk.org
	 * @author <a href="mailto:hans#hansk.org">Hans</a>
	 * @date 2013-8-7
	 */
	public class MainContext extends Context
	{
		public var main:Starling;
		public function MainContext(contextView:DisplayObjectContainer=null, autoStartup:Boolean=true)
		{
			super(contextView, autoStartup);
		}
		override public function startup():void
		{
			this.injector.mapValue(IContext,this);
			this.commandMap.mapEvent(ContextEvent.STARTUP,InitCommand,ContextEvent);
			this.dispatchEvent(new ContextEvent(ContextEvent.STARTUP));
		}
		override public function shutdown():void
		{
			
		}
	}
}